package com.hanxing.kxcharge.module.member.api.plate;


import com.hanxing.kxcharge.framework.common.pojo.CommonResult;
import com.hanxing.kxcharge.module.member.api.plate.dto.MemberPlateReqDTO;
import com.hanxing.kxcharge.module.member.service.plate.PlateService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

import static com.hanxing.kxcharge.framework.common.pojo.CommonResult.success;


/**
 * 车辆信息 API 实现类
 *
 * @author xiaohei
 */
@RestController // 提供 RESTful API 接口，给 Feign 调用
@Validated
public class MemberPlateApiImpl implements MemberPlateApi {

    @Resource
    private PlateService plateService;


    @Override
    public CommonResult<Boolean> addPlateNumber(Long userId, String plateNumber) {
        plateService.addPlateNumber(userId, plateNumber);
        return success(true);
    }

    @Override
    public CommonResult<Boolean> chargeOrder(MemberPlateReqDTO memberPlateReqDTO) {
        plateService.chargeOrder(memberPlateReqDTO);
        return success(true);
    }


}
